package com.booza.dao;

import java.util.List;

import com.booza.model.Stats;

/**
 * The DAO level interface for StatisticsService management.
 */
public interface StatisticsDAO
{
	/**
	 * Find players with most wins.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Returns players with most wins in descending order.
	 */
	List getPlayersWithMostWins(List<String> gameType);

	/**
	 * Find players with most wager wins.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Returns players with most wager wins in descending order.
	 */
	List getPlayersWithMostWagerWins(List<String> gameType);

	/**
	 * Find players with most centuries.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Returns players with most centuries in descending order.
	 */
	List getPlayersWithMostCenturies(List<String> gameType);

	/**
	 * Find players with most half centuries.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Returns players with most half centuries in descending order.
	 */
	List getPlayersWithMostHalfCenturies(List<String> gameType);

	/**
	 * Find players with most golden breaks.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Return players with most golden breaks in descending order.
	 */
	List getPlayersWithMostGoldenBreaks(List<String> gameType);

	/**
	 * Find players with most runouts.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Return players with most run outs in descending order.
	 */
	List getPlayersWithMostRunouts(List<String> gameType);

	/**
	 * Find players with most seven ballings.
	 * 
	 * @param gameType
	 *          - game for which this statistics applies to. Can be any one game or all games
	 * @return Returns players with most sevenballings in descending order.
	 */
	List getPlayersWithMostSevenBallings(List<String> gameType);

	/**
	 * Find players with most rankings.
	 * 
	 * @return Return players with most rankings in descending order.
	 */
	List findOverallRankings(List<String> gameType);

	/**
	 * Find a row in statistics table.
	 * 
	 * @param id
	 *          - id of the row
	 * @return statistics
	 */
	Stats findStats(Integer id);

	/**
	 * Find number of games lost by player for a particular game.
	 * 
	 * @param accountId
	 * @param gameType
	 * @return
	 */
	public List findLossesByPlayer(Integer accountId, List<String> gameType);

	/**
	 * Find number of games won by player for a particular game.
	 * 
	 * @param accountId
	 * @param gameType
	 * @return
	 */
	public List findWinsByPlayer(Integer accountId, List<String> gameType);

	/**
	 * Find number of abandoned games involed by player for a particular game.
	 * 
	 * @param accountId
	 * @param gameType
	 * @return
	 */
	public List findAbandonedGamesForPlayer(Integer accountId, List<String> gameType);

	/**
	 * Find player statistics from stats table.
	 */
	public List findPlayerStats(Integer accountId, List<String> gameType, String winCondition, String timeFrame);

	/**
	 * Find player statistics from stats table. Statistics for games which are abandoned by this player.
	 * 
	 * @param accountId
	 * @param gameType
	 * @param winCondition
	 * @param timeFrame
	 * @return
	 */
	List findPlayerStatsForAbandonedGames(Integer accountId, List<String> gameType, String winCondition, String timeFrame);

	/**
	 * Finds the total number of games played by given player.
	 * 
	 * @param accountId
	 * @return
	 */
	Integer findTotalGamesPlayed(Integer accountId);

	/**
	 * Finds Players with the most tournament wins.
	 * 
	 * @param gameType
	 * @return
	 */
	List getMostTournamentWins(List<String> gameType);
}
